package com.hzhjhh.util;

import java.util.Date;
import java.util.TimerTask;

import javax.swing.text.JTextComponent;

import com.hzhjhh.constant.DateFormatContants;

import cn.hutool.core.date.DateUtil;

/**
 * 获取当前时间，并赋给指定的组件
 * 
 * @author 12083
 *
 */
public class RemindTask extends TimerTask {

	private JTextComponent textComponent;

	public RemindTask(JTextComponent textComponent) {
		this.textComponent = textComponent;
	}

	@Override
	public void run() {
		textComponent.setText(DateUtil.format(new Date(), DateFormatContants.YYYY_MM_DD_HH_MM_SS));
	}
}
